﻿using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
using Jn698._45GWTool.Controls.RecordChoiceControls;
using Jn698._45GWTool.ModelViews;
using Jn698._45GWTool.ViewModels;
using Jn698._45GWTool.ViewModels.Controls;
using Jn698._45GWTool.ViewModels.Controls.DataControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFirst.Entities;

namespace Jn698._45GWTool.Common
{
    public class ViewModelLocator
    {
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
            SimpleIoc.Default.Register<MainViewModel>();
            SimpleIoc.Default.Register<CommViewModel>();
            SimpleIoc.Default.Register<ModeBitViewModel>();
            SimpleIoc.Default.Register<AppControlViewModel>();
            SimpleIoc.Default.Register<CONNECTControlViewModel>();
            SimpleIoc.Default.Register<CommonControlViewModel>();
            SimpleIoc.Default.Register<FrameMessageInfoViewModel>();
            SimpleIoc.Default.Register<FrameShowViewModel>();
            SimpleIoc.Default.Register<RecordChoiceViewModel>();
            SimpleIoc.Default.Register<ReadRecordViewModel>();
            SimpleIoc.Default.Register<RSDViewModel>();
            SimpleIoc.Default.Register<ROADViewModel>();
            SimpleIoc.Default.Register<ProxyTransmitViewModel>();
            SimpleIoc.Default.Register<ProxyTransmitCommViewModel>();
            SimpleIoc.Default.Register<PlanSetViewModel>();
        }
        public MainViewModel MainViewModel 
        {
            get 
            { 
                return ServiceLocator.Current.GetInstance<MainViewModel>();
            } 
        }

        public CommViewModel CommViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<CommViewModel>();
            }
        }

        public ModeBitViewModel ModeBitViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ModeBitViewModel>();
            }
        }

        public AppControlViewModel AppControlViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<AppControlViewModel>();
            }
        }
        public CONNECTControlViewModel CONNECTControlViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<CONNECTControlViewModel>();
            }
        }
        public CommonControlViewModel CommonControlViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<CommonControlViewModel>();
            }
        }
        public FrameMessageInfoViewModel FrameMessageInfoViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<FrameMessageInfoViewModel>();
            }
        }
        public FrameShowViewModel FrameShowViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<FrameShowViewModel>();
            }
        }

        public RecordChoiceViewModel RecordChoiceViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<RecordChoiceViewModel>();
            }
        }

        public ReadRecordViewModel ReadRecordViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ReadRecordViewModel>();
            }
        }

        public RSDViewModel RSDViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<RSDViewModel>();
            }
        }

        public ROADViewModel ROADViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ROADViewModel>();
            }
        }
        public ProxyTransmitViewModel ProxyTransmitViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ProxyTransmitViewModel>();
            }
        }
        public ProxyTransmitCommViewModel ProxyTransmitCommViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ProxyTransmitCommViewModel>();
            }
        }
        public PlanSetViewModel PlanSetViewModel
        {
            get
            {
                return ServiceLocator.Current.GetInstance<PlanSetViewModel>();
            }
        }
    }
}
